<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app"> </div>
    <div id="bmw"></div>
    <script src="./vue.js"></script>
    <script>
        // Vue.extend() 一个vue的构造器
        // 可以实例化Vue组件  设置props 实例化时候用propsData传参
        var Car = Vue.extend({
            // render(h) {
            //     h("div", "<div>{{username}}</div>")
            // },
            template: `<div>{{username}}</div>`,
            data() {
                return {}
            },
            props: ["list", "username"],
            methods: {
                run() {
                    console.log(999)
                }
            },
        })

        var benchi = new Car({
            propsData: {
                list: [1, 2, 3],
                username: "奔驰"
            }
        }).$mount("#app")
        var bmw = new Car({
            propsData: {
                list: [1, 2, 3],
                username: "宝马"
            }
        }).$mount("#bmw")
    </script>
</body>
<script>
    //
</script>

</html>